#pragma once

#include <Windows.h>
#include <DataManager.h>
#include <StyleLoader.h>
#include <DataFactory.h>

#include "MainScene.h"

#define GAF_pTHEMYAPP		((CClientApp*)GAF_pTHEAPP)

typedef CStyleLoader*		(LOADSTYLE)(GAF_CApplication* pHostApp, STD_STRING strLoaclPath);
typedef void			(UNLOAFSTYLE)();

class CClientApp : public GAF_CApplication, public IDataReader, public IDataOutputAbility
{
public:
	CClientApp();
	~CClientApp();

public:
	GAF_CPlatform*		GetUsePlatform();

protected:
	GAF_CScene*		OnCreateApp(_OUT GAF_SCreateWindow& cw);
	bool			OnInitApp();
	void			OnDestroyApp();

public:
// 	DDataIDs		SearchData(EDataForm df, SDataSelect& dsKey);
	bool			GetData(MCT::IDInfo idiTarget, __out MCT::Data* pdOut);

public:
	CStyle*			GetStyle();

private:
	bool			LoadStyleLoader(STD_STRING strPath, STD_STRING strName);
	void			UnloadStyleLoader();

private:
	HMODULE			m_hStyleDll;
	CStyleLoader*		m_pStyleLoader;

private:
	CMainScene		m_MainScene;
};
